package drone.basis.dictionary ;

public enum UrgentDict
{

	NONE ( "不分类" ) ,
	REPAIR ( "设备故障" ) ,
	NATURE ( "自然灾害" ) ,
	STAIN ( "化学污染" ) ,
	DOWN ( "运营中断" ) ,
	BURST ( "突发事件" ),;

	private String name ;

	private UrgentDict (
			String name
	)
	{
		this.name = name ;
	}

	public String getName ( )
	{
		return name ;
	}

	public void setName (
			String name
	)
	{
		this.name = name ;
	}
	
	public static String code (
			String code
	)
	{
		for ( UrgentDict item : UrgentDict.values ( ) )
		{
			if ( item.name ( ).equalsIgnoreCase ( code ) || item.getName ( ).equalsIgnoreCase ( code ) )
			{
				return item.name ( ) ;
			}
		}
		return null ;
	}

	public static Boolean exist (
			String name
	)
	{
		for ( UrgentDict item : UrgentDict.values ( ) )
		{
			if ( item.name ( ).equalsIgnoreCase ( name ) || item.getName ( ).equalsIgnoreCase ( name ) )
			{
				return true ;
			}
		}
		return false ;
	}

}
